# -*- coding: utf-8 -*-
"""
Created on Tue Aug  2 16:41:37 2016

@author: XT-YY

test get json data from sohu
"""

import urllib, json
import time

url = ("http://q.stock.sohu.com/hisHq?code=cn_511990&start=20160701&end=20160801&stat=1&"
       "order=D&period=d")  # the web is modified
response = urllib.request.urlopen(url);
a = response.read().decode("gbk")
data = json.loads(a, encoding="gbk")
data = data[0]['hq']
print(data)